/*
 * WordPerfectHandler.java
 *
 * Created on 16 January 2010, 1:48
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package fasea.index.filehandler;

import java.io.File;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;

/**
 *
 * @author gvasil
 */
class WPDHandler extends FileHandler {
    
  public Document getTypedDocument(File file) throws FileHandlerException {

      org.apache.lucene.document.Document doc = createDefaultLuceneDocument(file);
      
      String text = getText(file);
      
      if (text != null && text.trim().length() > 0) {
          doc.add(new Field("content", text, Field.Store.NO,
                  Field.Index.ANALYZED, Field.TermVector.WITH_OFFSETS));
      }
      return doc;
  }

  private String getText(File file) throws FileHandlerException {
      //XXX TODO: fix this!
      return "";
  }

  
}